export default (query: AnyObject | undefined) => {
  if (query?.onlyid) {
    $api.postAdClick({ onlyid: query.onlyid });
  }

  if (query?.channelId) {
    const val = parseInt(query.channelId);
    if (val === 4) {
      const onlyid = Object.entries(query)
        .map(
          (item) =>
            `${encodeURIComponent(item[0])}=${encodeURIComponent(item[1])}`
        )
        .join('&');
      $api.postAdClick({ onlyid });
    }
  }
};
